package com.shop.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shop.pojo.sms.Sms_Seckill_Sku_Relation;
import com.shop.service.Sms_Seckill_Sku_Relation_Service;
import com.shop.utils.LayuiUtils;
import com.shop.utils.R;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 秒杀活动商品关联
 */
@RestController
@RequestMapping("/seckill_sku_relation")
public class Sms_Seckill_Sku_Relation_Controlle {

    @Autowired
    private Sms_Seckill_Sku_Relation_Service sms_seckill_sku_relation_service;


    /***
     * 秒杀活动商品关联显示
     * @param page
     * @param limit
     * @param sssr
     * @return
     */
    @GetMapping("/find_admin_seckill_sku_relation_All")
    public LayuiUtils<Sms_Seckill_Sku_Relation>  find_admin_seckill_sku_relation_All
            (Integer page,Integer limit,Sms_Seckill_Sku_Relation sssr){

        Page<Sms_Seckill_Sku_Relation>  Pages = new Page<>(page,limit);

        return sms_seckill_sku_relation_service.find_admin_seckill_sku_relation_All(Pages,sssr);
    }

    /**
     * 秒杀活动商品关联新增
     * @param sssr
     * @return
     */
    @PostMapping("/insert_admin_seckill_sku_relation_All")
    public R  insert_admin_seckill_sku_relation_All(Sms_Seckill_Sku_Relation sssr){
        System.out.println(sssr);
        return sms_seckill_sku_relation_service.insert_admin_seckill_sku_relation_All(sssr);
    }

    /***
     * 秒杀活动商品关联删除
     * @param id
     * @return
     */
    @DeleteMapping("/del_admin_seckill_sku_relation_All")
    public R  del_admin_seckill_sku_relation_All(@RequestParam List<Integer> id){

        return sms_seckill_sku_relation_service.del_admin_seckill_sku_relation_All(id);
    }

    /**
     * 秒杀活动商品关联修改
     * @param sssr
     * @return
     */
    @PutMapping("/up_admin_seckill_sku_relation_All")
    public R  up_admin_seckill_sku_relation_All(Sms_Seckill_Sku_Relation sssr){

        return sms_seckill_sku_relation_service.up_admin_seckill_sku_relation_All(sssr);
    }

}
